{extend name="public/base" /}
{block name="body"}
<style>
    .layui-form-selected dl {
        z-index: 9999;
    }
</style>
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">新增文章</div>
            <div class="layui-card-body">
                <form action="{:url('')}" class="layui-form" lay-filter="example" method="post">
                    <div class="layui-tab">
                        <ul class="layui-tab-title">
                            <li class="layui-this">基本信息</li>
                            <li>文章设置</li>
                        </ul>
                        <div class="layui-tab-content layui-row">
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">文章标题：</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input" lay-verify="required" name="title"
                                               type="text">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">所属分类：</label>
                                    <div class="layui-input-inline">
                                        <select name="category_id">
                                            {volist name="dclist" id="vo"}
                                            <option value="{$vo.id}" {$vo['id']==$cid?"selected":""}>{$vo.title}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">封面：</label>
                                    <div class="layui-input-block">
                                        <div class="zz-upload-pic">
                                            <button class="layui-btn zzBtnUpload" type="button">
                                                <i class="layui-icon">&#xe67c;</i>上传图片
                                            </button>
                                            <input class="zz-upload-value" name="cover_path" type="hidden" value="">
                                            <div class="zz-upload-pic-show layui-row"></div>
                                        </div>
                                        <script src="__JS__/upload.js"></script>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">文章内容：</label>
                                    <div class="layui-input-block">
                                        <script style="height:400px" id="editor" name="content" type="text/plain">
										
										</script>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">设置属性：</label>
                                    <div class="layui-input-block">
                                        <input type="checkbox" name="display" lay-text="显示|隐藏" lay-skin="switch" value="1" checked>
                                        <input type="checkbox" name="isrecommend" lay-text="推荐|不推荐" lay-skin="switch" value="1">
                                        <input type="checkbox" name="istop" lay-text="置顶|不置顶" lay-skin="switch" value="1">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">排序：</label>
                                    <div class="layui-input-inline">
                                        <input class="layui-input" lay-verify="required" name="sort"
                                               type="text" value="99">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">外链：</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input" name="link_str"
                                               placeholder="若填写，该文章将直接跳转到该链接" type="text">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">关键字：</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input" name="keywords"
                                               placeholder="文章关键词，用于搜索引擎优化" type="text">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">描述：</label>
                                    <div class="layui-input-block">
                                        <textarea class="layui-textarea" name="description"
                                                  placeholder="文章描述，用于搜索引擎优化"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-layout-admin">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-filter="zz-btn-submit" lay-submit="" type="submit">立即提交
                            </button>
                            <button class="layui-btn layui-btn-primary zz-btn-cancel" type="button">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="__LIB__/ueditor/ueditor.config.js"></script>
<script src="__LIB__/ueditor/ueditor.all.min.js"></script>
<script src="__LIB__/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    var ue = UE.getEditor('editor',{
        serverUrl: "{:url('Ueditor/index')}",
    });
</script>
{/block}